﻿<%@ Page Language="C#" Title="新增交换设备" MasterPageFile="~/SubWindow.master"  AutoEventWireup="true" CodeBehind="AddExchange.aspx.cs" Inherits="Com.Crc.ResManage.Web.EquipManage.Exchange.AddExchange" %>

<%@ Register Assembly="Infragistics2.WebUI.UltraWebGrid.v7.2, Version=7.2.20072.61, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"
    Namespace="Infragistics.WebUI.UltraWebGrid" TagPrefix="igtbl" %>

<asp:Content ID="Content2" ContentPlaceHolderID="SubContent" runat="server">
        <table>
            <tr>
                <td>
                    <table>
                        <tr>
                            <td class="td_content">
                                <asp:Label ID="lblBranchOffice" runat="server" Text="所属分局" 
                                    style="font-size:12px"></asp:Label></td><td class="td_content">
                                <asp:DropDownList
                                    ID="ddlBranchOffice" runat="server" Width="100px">
                                </asp:DropDownList>
                            </td>
                            <td class="td_content">
                                <asp:Label ID="lblOffice" runat="server" Text="所属局点"
                                        ></asp:Label></td><td class="td_content"><asp:DropDownList
                                    ID="ddlBranch" runat="server" Width=100>
                                </asp:DropDownList>
                            </td>
                            <td class="td_content"><asp:Label ID="Label1" runat="server" Text="局点名称"
                                ></asp:Label></td><td class="td_content">
                                <asp:DropDownList
                                    ID="ddlOffice" runat="server" Width="100px">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbluntitypeid" runat="server" Text="设备型号"></asp:Label></td><td class="td_content"><asp:DropDownList ID="unittypeid" runat="server" Width=100></asp:DropDownList>
                            </td>
                            <td>
                                <asp:Label ID="lblname" runat="server" Text="设备名称:"></asp:Label></td><td class="td_content">
                                <asp:TextBox ID="textname" runat="server"></asp:TextBox>    
                            </td>
                            <td>
                                <asp:Label ID="lbl2m" runat="server" Text="2M数量:"></asp:Label></td><td class="td_content">
                                 <asp:TextBox ID="text2m" runat="server"></asp:TextBox> 
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lblmodelno" runat="server" Text="模块号:"></asp:Label></td><td class="td_content">
                                <asp:TextBox ID="textmodelno" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="lblv5" value="" runat="server" Text="接入网V5接口号:" /></td><td class="td_content">
                                <asp:TextBox ID="textv5" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>上端交换机</td><td class="td_content">
                            <asp:DropDownList ID="upexchange" runat="server" Width=100>
                            </asp:DropDownList></td>
                            <td>
                            <asp:Label ID="lblexchangeport" value="" runat="server" Text="上端交换机端口" /></td><td class="td_content">
                                <asp:TextBox ID="textexchangeport" runat="server"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Label ID="lbles" runat="server" Text="开始设备号"></asp:Label></td><td class="td_content">
                                <asp:TextBox ID="textes" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                <asp:Label ID="lblee" runat="server" Text="结束设备号"></asp:Label></td><td class="td_content">
                                <asp:TextBox ID="textee" runat="server"></asp:TextBox>
                            </td>
                            <td><asp:Label ID="lblbak" runat="server" Text="备注"></asp:Label></td><td class="td_content">
                                <asp:TextBox ID="textbak" runat="server"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td>
                                <asp:Button ID="Button1" runat="server" Text="保存" onclick="btnAdd_Click"  
                                        CssClass="inputbutton" />
                                        </td><td class="td_content"><asp:Button ID="Button2" runat="server" Text="清空" CssClass="inputbutton" 
                                    onclick="btnDelete_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    <igtbl:ultrawebgrid ID="grd" runat="server" OnInitializeLayout="grd_InitializeLayout"
                        OnPageIndexChanged="grd_PageIndexChanged" style="top: 0px; left: 0px; height: 200px">
                        <DisplayLayout BorderCollapseDefault="NotSet" Name="gridxrole" RowHeightDefault="22px"
                            StationaryMarginsOutlookGroupBy="True" TableLayout="Fixed" Version="4.00" AutoGenerateColumns="False"
                            SelectTypeRowDefault="Single" CellClickActionDefault="RowSelect" RowSelectorsDefault="No"
                            CellPaddingDefault="1" CellSpacingDefault="1" ScrollBar="Never">
                            <ClientSideEvents CellClickHandler="OnCellClick" />
                            <ActivationObject BorderWidth="" BorderColor="153, 153, 153">
                            </ActivationObject>
                            <RowStyleDefault BackColor="LightBlue" BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana"
                                Font-Size="8pt" BorderColor="#669999" ForeColor="#74776A">
                                <Padding Left="3px" />
                            </RowStyleDefault>
                            <EditCellStyleDefault BorderStyle="None" BorderWidth="0px">
                            </EditCellStyleDefault>
                            <RowAlternateStyleDefault BackColor="BurlyWood">
                            </RowAlternateStyleDefault>
                            <FrameStyle BorderStyle="Solid" BorderWidth="0px" Font-Names="Verdana" Font-Size="8pt"
                                BorderColor="#354A54" Height="0px">
                                <BorderDetails StyleBottom="None" StyleLeft="None" StyleRight="None" StyleTop="None" />
                            </FrameStyle>
                            <HeaderStyleDefault BorderStyle="Solid" BorderWidth="0px" BorderColor="#354A54" Height="22px"
                                BackColor="#01212F" ForeColor="White">
                            </HeaderStyleDefault>
                            <Pager AllowPaging="True" PageSize="20" Pattern="&lt;table&gt;&lt;tr&gt;&lt;td align=right&gt;Per page:[pagesize] Page:[default]&lt;td&gt;&lt;/tr&gt;&lt;/table&gt; " StyleMode="PrevNext">
                            </Pager>
                        </DisplayLayout>
                        <Bands>
                            <igtbl:UltraGridBand >
                                <Columns>
                                    <igtbl:UltraGridColumn >
                                        <Header Caption="Column 0">
                                        </Header>
                                    </igtbl:UltraGridColumn>
                                </Columns>
                                <AddNewRow View="NotSet" Visible="NotSet">
                                </AddNewRow>
                            </igtbl:UltraGridBand>
                        </Bands>
                    </igtbl:ultrawebgrid>
                </td>
            </tr>
            <tr>
                <td colspan=8>
                    <table>
                        <tr>
                            <td>
                                <asp:Button ID="btnAdd" runat="server" Text="新增" CssClass="inputbutton" />
                            </td>
                            <td>
                                <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="inputbutton" 
                                    onclick="btnDelete_Click" />
                            </td>
                            <td>
                                <asp:Button ID="btn_Search" Width=0 runat="server" Text="删除" 
                                    CssClass="inputbutton" onclick="btn_Search_Click" />
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <script type="text/javascript">
            function OpenAddWindow() {
                var equipId = "<%= EquipID %>";
                var strReturn = window.showModalDialog('addExchangeUserBoard.aspx?optype=1&equipid=' + equipId, '', 'dialogWidth:900px;dialogHeight:625px;center:yes;help:no;status:no;');
                var refresh = document.getElementById("<%= this.btn_Search.ClientID %>");
                refresh.click();
                if (strReturn != null) {
                    return true;
                }
                return false;
            }

            function SelectAll(oGrid, checkbox) {
                var o = igtbl_getGridById(oGrid);
                var oRows = o.Rows;
                for (i = 0; i < oRows.length; i++) {
                    (oRows.getRow(i).getCellFromKey("CHECK")).setValue(checkbox.checked);
                }
            }

            function OnCellClick(table, cell) {
                var cell = igtbl_getCellById(cell);
                if (cell == null) {
                    return true;
                }
                else {
                    if (cell.Column.Key == "Edit") {
                        var equipId = "<%= EquipID %>";
                        var userBoardId = cell.Row.getCellFromKey("N_ID").getValue();
                        alert(userBoardId);
                        window.showModalDialog('addExchangeUserBoard.aspx?optype=0&equipid=' + equipId
                        + '&userboardid=' + userBoardId, '', 'dialogWidth:900px;dialogHeight:625px;center:yes;help:no;status:no;');

                        var refresh = document.getElementById("<%= this.btn_Search.ClientID %>");
                        refresh.click();

                        return false;
                    }
                }

            }
        </script>
</asp:Content>